package com.eastfair.common.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.eastfair.boot.request.PageParams;
import com.eastfair.boot.service.SuperService;
import com.eastfair.common.dto.AuthCodeDTO;
import com.eastfair.common.entity.AuthCode;
import com.eastfair.common.vo.AuthCodeVO;
import com.eastfair.core.base.R;

import java.util.List;

/**
 * <p>
 * 业务接口
 * 服务商对外授权码
 * </p>
 *
 * @author dqq
 * @date 2023-02-14
 */
public interface AuthCodeService extends SuperService<AuthCode> {

    /**
     * 授用用户ID查询授权码信息.
     *
     * @param authCodeDTO the auth code dto
     * @return the vo by auth user id
     */
    R<AuthCodeVO> getVOByAuthUserId(AuthCodeDTO authCodeDTO);

    /**
     * 分页查询授权码VO.
     *
     * @param params the params
     * @return the list
     */
    Page<AuthCodeVO> listAuthCodeVO(PageParams<AuthCodeDTO> params);

    /**
     * ID 查询授权码.
     *
     * @param id the id
     * @return the vo by id
     */
    AuthCodeVO getVOById(Long id);

    /**
     * 授权码查询.
     *
     * @param authCode the auth code
     * @return the by auth code
     */
    AuthCode getByAuthCode(String authCode);

    /**
     * 授权码查询有效的授权码.
     *
     * @param authCode the auth code
     * @return the by auth code
     */
    AuthCode getValidByAuthCode(String authCode);

    /**
     * 保存授权码.
     *
     * @param authCodeDTO the auth code dto
     * @return the boolean
     */
    boolean saveAuthCode(AuthCodeDTO authCodeDTO);

    /**
     * 编辑授权码.
     *
     * @param authCodeDTO the auth code dto
     * @return the boolean
     */
    boolean updateAuthCode(AuthCodeDTO authCodeDTO);

    /**
     * 移除授权码.
     *
     * @param ids the ids
     * @return the boolean
     */
    boolean removeAuthCodeByIds(List<Long> ids);
}
